<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="../static/css/header.css" type="text/css">
    <style>
        .person-main{
            width: 100%;
        }
        .person-body{
            width: 800px;
            height: 500px;
            margin: 50px auto;
        }
        .person-img{
            margin: 0 auto;
            width: 120px;
            height: 120px;
        }
        .person-img img{
            width:120px;
            height: 120px;
        }
        .person-list{
            margin: 30px 0;
            text-align: center;
            width: 800px;
            height: 300px
        }
        .person-list div{
            height: 40px;
            width: 800px;
            line-height: 40px;
            border-bottom: 1px solid #ccc;
        }
    </style>
    <script>
        function getPersonType(){
            let userID = document.getElementById("person-img").title;
            let type = document.getElementById("person-type");
            if(userID.includes("admin")){
                type.innerText="用户类别：管理员";
            }
            else if(userID.includes("T")){
                type.innerText="用户类别：教师";
            }
            else if(userID.includes("F")){
                type.innerText="用户类别：辅导员";
            }
            else if(userID.includes("B")){
                type.innerText="用户类别：班主任";
            }
            else if(userID.includes("J")){
                type.innerText="用户类别：教秘";
            }
            else {
                type.innerText="用户类别：学生";
            }
        }
    </script>
</head>
<body>
<div class="header">
    <div class="header-title">
        <div class="header-title-logo">
        </div>
        <div class="header-title-body">
            <h2>教务管理系统</h2>
        </div>
        <div class="header-title-quit">
            <a href="/login">安全退出</a>
        </div>
        <div class="header-title-person">
            <a href="">
                <img id="person-img" th:title="${userID}" src="../static/images/a0.jpg"/>
            </a>
        </div>
    </div>
</div>
<div class="person-main">
    <div class="person-body">
        <div class="person-img">
            <img src="../static/images/a0.jpg"/>
        </div>
        <div class="person-list">
            <div th:text="'编号:'+${user.getUserID()}"></div>
            <div th:text="'姓名:'+${user.getUserName()}"></div>
            <div th:text="'性别:'+${user.getSex()}"></div>
            <div th:text="'部门:'+${college}"></div>
            <div th:text="'手机:'+${user.getPhoneNumber()}"></div>
            <div id="person-type"></div>
        </div>
    </div>
</div>
<script>
    getPersonType();
</script>
</body>
</html>